/**
 * Copyright (c) 2015-2030 by Beijing Yanlight Co., Ltd.
 * All rights reserved.
 */
package com.yanlight.type;

/**
 * 
 * @author haolw
 * @time 2017/08/18
 */
public enum BooleanType {
	FALSE, TRUE;

	public static Integer transform(Boolean value) {
		if (value) {
			return TRUE.ordinal();
		} else {
			return FALSE.ordinal();
		}
	}

	public static Boolean transform(Integer value) {
		if (value == null) {
			return Boolean.FALSE;
		} else {
			if (value.equals(TRUE.ordinal())) {
				return Boolean.TRUE;
			} else {
				return Boolean.FALSE;
			}
		}
	}
}
